#include "main.h"
#include "bsp_activeBuzzer.h"
#include "ndata.h"
#include "global.h"

ManActiveBuzzer manActiveBuzzer;

void manActiveBuzzerDigitalWrite(uint8_t v){
    digitalWrite(15,v);
}

void bspActiveBuzzerInit(){
    pinMode(15, OUTPUT);
    ManActiveBuzzer::digitalWrite=manActiveBuzzerDigitalWrite;
    manActiveBuzzer.setMode(3);
}


extern "C" int buzzer_shell(int argc, char* agrv[])
{
    int v = atoi(agrv[1]);
    manActiveBuzzer.setMode(v);


    Ndata ndata;
    ndata.SetWord(v);
    __ctMain.m_inNfifo->PushNtapes((void *)ndata.Buffer(),ndata.Length());


    return v+5;
}

